1. Field of the Invention
The present invention relates to a slot accessing method in an object-oriented expert system, wherein a plurality of rules on predetermined knowledge are carried out for inference.
2. Description of the Related Art
There has been recently realized an object-oriented expert system which has a knowledge base having a plurality of rules on predetermined knowledge stored therein and class structure of modeled problem objects and wherein the stored rules are carried out for inference.
In an object-oriented language, the concept of class and instance is used to modelize a problem object. In the class, a plurality of slots (attributes) can be defined, and as values of the slots, objects such as character strings, numerals, lists, classes and instances are given. As means for easily realizing the side effect of slot access (value reference and assignment), there is such an active value mechanism. In this mechanism, in accessing a slot having an instance of a class "active value" as its slot value, a reference function of an active value is activated when referencing to the slot value and an assignment function of the active value is activated when assigning the slot value. The "active value" refers to a value which causes the side effect when the slot is accessed.
The slot accessing operation based on the active value mechanism will be briefly explained by reflecting to FIGS. 19 to 21.
Referring first to FIG. 19, there is shown an example of instances belonging to a class "household", in which instances 1a to 4a have corresponding slots 1b to 4, respectively.
Shown in FIG. 20 is an example of instances belonging to a class "active value", in which instances 5a to 8a have corresponding slots 5b to 8b, respectively.
In more detail, the instance 1a (instance "Tanaka") in FIG. 19 has slots "saving", "income", "expenditure", "insurance fee", etc., which are associated with the instances 5a, . . . 8a in FIG. 20, respectively.
FIG. 21 shows an example of hierarchical reference rules, in which case reference rules 1 to 4 are set having different rule contents.
Turning again to FIG. 19, at the time of referring to one "saving" of the slots 1b of the "Tanaka" instance 1a, the reference rule 1 corresponding to the reference function of the instance 5a (instance AV1) of the class "active value" in FIG. 20 is invoked. When the reference rule 1 is executed, the reference rule 2 for the reference function of the instance 6a (instance AV2) and the reference rule 3 for the reference function of the instance 7a (instance AV3) are invoked and executed according to the corresponding reference rules of FIG. 21. Similarly, when the reference rule 3 of the instance 7a (instance AV3) is executed, the reference rule 4 for the reference function of the instance 8a (instance AV4) is invoked and executed according to the corresponding reference rule of FIG. 21.
Through the hierarchical reference rules invoked and executed in this way, the slot "saving" in the slots 1b of the "Tanaka" instance 1a can be found.
In such a prior art object-oriented expert system as mentioned above, however, when the active value is applied to the slot having such hierarchical reference rules as the reference rules 1 to 4 shown in FIG. 21, all the four reference rules 1 to 4 are always invoked. In this way, the prior art expert system has been defective in that the application of the active value to the slot having such hierarchical reference rules causes unnecessary repetitive computation of slot values, which results in that the reference to the slot value requires a lot of processing time.